//
//  ContentItemObject.m
//  helpinrain
//
//  Created by Gang.Wang on 12-7-26.
//  Copyright (c) 2012年 Zhuhai Yuike Technology Co., Ltd. All rights reserved.
//

#import "ContentItemObject.h"
#import "mcf.h"

@implementation ContentItemObject

@synthesize content = content_;
@synthesize contentType = contentType_;

- (void) dealloc
{
    YRelease(content_)
    
    [super dealloc];
}

-(id) initWithXmlTree:(XMLParsedTree *)tree
{
    self = [super initWithXmlTree:tree];
    if(self)
    {        
        NSString * strType = [self.xmlTree attributeValueOfName:@"type" atPath:@"content"];
        if([strType isEqualToString:@"text"])
        {
            self.contentType = kContentItemObjectType_Text;
        }
        else if ([strType isEqualToString:@"image"]) 
        {
            self.contentType = kContentItemObjectType_Image;
        }
        
        self.content = [self.xmlTree valueAtPath:@"content"];
    }
    return self;
}


@end
